home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
oop_tp55.zip
/
LIST5_1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-02-01
|
697b
|
41 lines
program Listing5_1;
type
Elf = object
Name : string;
constructor Init( Monicker : string );
procedure ShopScript;
procedure GoShopping;
end;
constructor Elf.Init( Monicker : string );
begin
Name := Monicker;
end;
procedure Elf.ShopScript;
begin
writeln( '<Door slams as ', Name, ' leaves>');
writeln( '<long pause.......>' );
writeln( '<Door slams as ', Name, ' returns>');
writeln( Name, ': I went to the store and bought milk and eggs.');
end;
procedure Elf.GoShopping;
begin
ShopScript;
end;
var
Jay : Elf;
begin
Jay.Init( 'JAY' );
Jay.GoShopping;
end.
{ Listing 5-1 }